export interface BaseType {
    code: number,
    message: string,
    ok: boolean
}

export interface UserData {
    id?: number | string,
    createTime?: string
    updateTime?: string,
    username?: string,
    password?: string,
    name?: string,
    phone: null,
    roleName: string
}

export interface ResUserType extends BaseType {
    records: UserData[],
    total: number,
    size: number,
    current: number,
    pages: number
}


// 获取用户的角色的类型
export interface Role {
    id?: number,
    createTime?: string,
    updateTime?: string,
    roleName: string,
    remark: null
}

export interface AllRoleRes extends BaseType {
    data: {
        assignRoles: Role[],
        allRolesList: Role[]
    }
}

// 分配角色
export interface SetRole {
    userId: number,
    roleIdList: number[]
}

// 权限菜单
export interface MenuData {
    id?: number,
    createTime: string,
    updateTime: string,
    pid: number,
    name: string,
    code: string,
    toCode: string,
    status: null,
    level: number,
    children?: MenuData[],
    select: boolean
}

export interface ResMenuType extends BaseType {
    data: MenuData[]
}

